package com.learning.rpc.remoting.netty;

import com.learning.rpc.remoting.RpcChannel;
import io.netty.channel.Channel;

/**
 * ClassName: NettyChannel
 * Description: 封装的 Netty Channel
 * Date: 2022/5/11 0:00 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
public class NettyChannel implements RpcChannel {

    private Channel channel;

    public NettyChannel(Channel channel) {
        this.channel = channel;
    }

    @Override
    public void send(byte[] message) {
        channel.writeAndFlush(message);
    }
}
